package tk3.project.uploadservice;
import java.io.File;
import java.util.Date;
import java.util.Vector;

import javax.swing.plaf.SliderUI;

 

public class Tests {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Date d=new Date((new Date()).getTime()+10000*360*1);
		System.out.println(d);
		
		//clientTest();
		//utiltests();
	}
	
	public static void DeSerializeTest(){
		
		//send Pictures
		Vector<Picture> p=new Vector<Picture>();
		p.add(new Picture(new File("IMG.JPG"), 1, 2, 3, 4));
		p.add(new Picture(new File("IMG2.JPG"), 5, 6, 7, 8));
		MsgDecomposer m=new MsgDecomposer(MsgComposer.submitPictures(p),"");
		System.out.println("ok"+m.getPictures().get(0).getLon()+" "+m.getPictures().get(0).getLat());
		System.out.println("ok"+m.getPictures().get(1).getLon()+" "+m.getPictures().get(1).getLat());
		
		//acks
		m=new MsgDecomposer(MsgComposer.ack(599),"");
		System.out.println("ACKS: "+m.getType()+" "+m.getAcks());
		
		m=new MsgDecomposer(MsgComposer.pullPictures(12.345, 67.890, 750),"");
		System.out.println("PullPictures: "+m.getLon()+" "+m.getLat()+" "+m.getRadius());
	}
	
	public static void clientTest(){
		Client c=new Client("localhost", 44444,"");
		c.start();
		Vector<Picture> p=new Vector<Picture>();
		p.add(new Picture(new File("IMG.JPG"), "strom","pass",2));
		p.add(new Picture(new File("IMG2.JPG"), "strom2","pass2",3));
		//System.out.println(p.get(0).distance(50.9, 6.9004));
		//MsgDecomposer m=new MsgDecomposer(MsgComposer.submitPictures(p));
		//p.add(new Picture(new File("exe.jpg"), 5, 6, 7, 8));
		//c.sendPicture(new Picture(new File("IMG.JPG"), "strom","pass",2));
		
		c.getPictures("strom","pass");
		
		
	}
public static void utiltests(){
	//System.out.println(Util.bytesToString(Util.stringToBytes("Bla Bla!:$%12456789#-+"))+"x");
	//Picture p=new Picture(new File("IMG.JPG"), "strom", "mypass", 4);
	//Picture p2=new Picture(new File("IMGNEW.JPG"), p.getBytes());
	//System.out.println("type: "+p2.getType()+" stram: "+p2.getStream()+" pwd: "+p2.getPassword()+" sharedur: "+p2.getShareDuration());
	//MsgDecomposer m=new MsgDecomposer(MsgComposer.pullPictures("strom", "pass"));
	//System.out.println("READ"+m.getStream()+" "+m.getPassword());
}
}
